const path = require('path');
// const WebpackBundleAnalyzer = require('webpack-bundle-analyzer');

module.exports = {
  mode: 'development',
  devtool: 'eval-source-map',
  devServer: {
    port: 8081,
    hot: true,
    static: {
      directory: path.join(__dirname, 'dist'),
    },
    historyApiFallback: {
      rewrites: [
        {
          from: /^\/$/,
          to: '/index.html'
        },
        {
          from: /^\/index/,
          to: '/index.html'
        },
        {
          from: /^\/publish/,
          to: '/publish.html'
        },
        {
          from: /^\/creator/,
          to: '/creator.html'
        }
      ]
    },
  },
  plugins: [
    // new WebpackBundleAnalyzer.BundleAnalyzerPlugin()
  ],
};